package network;

import network.server.ModeHandlerThread;
import messages.BaseMessage;

public abstract class BaseModeHandler {
    
    protected ModeHandlerThread parent;
    
    public BaseModeHandler(ModeHandlerThread parent)
    {
        this.parent = parent;
    }
    
    public abstract boolean enterMode(byte id);

    public abstract ConnectionMode getMode();

    public abstract void exitMode();

    /**
     * This method should handle all of the messages received while in a certain
     * mode. When this method returns, it should return the new mode for the
     * connection.
     * 
     * @return the new mode
     */
    public abstract ConnectionMode handleMessage(BaseMessage message);

}
